package eclipse1;

public class Test3 {
    public static void main(String[] args) {
        // 新建point对象
        // 内存地址分别保存到变量p1,p2
        Point p1 = new Point();
        Point p2 = new Point();
        // 为p1,p2的xy属性赋值
        p1.coordinateX = 3;
        p1.coordinateY = 4;

        p2.coordinateX = 6;
        p2.coordinateY = 8;
        // 分别调用两个对象的distance()和toString()
        // 并打印方法的返回值
        System.out.println(p1.distance());
        System.out.println(p2.distance());

        System.out.println(p1.toString());
        System.out.println(p2.toString());
    }
}
